#include "stm32_common.h"
#include <stdio.h>
#include "sharertos.h"

void delay(int ms)
{
  int m,n;
  for(m=0;m<4000;m++){
   for(n=0;n<ms;n++){

   }
  }
}


void usertask1(void *arg)
{
	for(;;)
	{	
  		Share_BspLEDToggle(LED1);
		delay(1000);
		os_tasksched();
	}
}

void usertask2(void *arg)
{
	for(;;)
	{	
  		Share_BspLEDToggle(LED2);
		delay(1000);
		os_tasksched();
	}
}

int main(void)
{
 Share_BspInit();
 ostaskcreatestatic(&u_tcb1,usertask1,NULL,NULL,0,&taskstk1[0],64);
 ostaskcreatestatic(&u_tcb2,usertask2,NULL,NULL,1,&taskstk2[0],64);
 osstart();
 while(1)
 {
  Share_BspLEDToggle(LED3);
  delay(1000);
 }
}
